import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by liyanwei on 2017/10/22.
 */
public class AppProducer {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("producer.xml");

        ProducerService producerService = context.getBean(ProducerService.class );

        for (int i = 0 ;i <100 ;i++){
            producerService.sendMessage("Message" + i);
        }

    }
}
